package com.ebarlas.fractal.gui;

import java.awt.BorderLayout;
import java.awt.Image;

import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;

public class ImageViewer {   

    public static void showImage(Image image) {
        JLabel label = new JLabel();
        label.setIcon(new ImageIcon(image));
        
        JPanel panel = new JPanel();
        panel.setLayout(new BorderLayout());        
        panel.add(label, BorderLayout.CENTER);
        
        JFrame frame = new JFrame();
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);        
        frame.getContentPane().setLayout(new BorderLayout());
        frame.getContentPane().add(panel, BorderLayout.CENTER);
        frame.pack();
        frame.setVisible(true);        
    }
    
}
